/*
 *------------------------------------------------------------------------------
 * @File      :    camera_usr.h
 * @Date      :    2021-3-20
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MDP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */

#ifndef __CAMERA_USR_H__
#define __CAMERA_USR_H__

#if defined(__EOS__)
#include "ei_posix.h"
#else
#include <string.h>
#endif
#include "ei_ae_comm.h"
#include "ei_comm_camera.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

EI_S32 CAMERA_I2C_Reg_Ops(I2C_INFO_S *);
EI_S32 CAMERA_SensorPowerDown(VISS_DEV, SNS_STATE_S *);
EI_S32 CAMERA_SensorPowerUp(VISS_DEV, SNS_STATE_S *);
extern EI_S32 VISS_SensorRegCallBack(VISS_DEV VissDev, SENSOR_S *pstSns);
extern EI_S32 VISS_SensorUnRegCallBack(VISS_DEV, SENSOR_ID);
extern EI_S32 MI_VISS_SetDevPinState(VISS_DEV VissDev, CAMERA_POWER_ACT_S *pAct);
extern EI_S32 MI_VISS_SnsPower(VISS_DEV, EI_U32);
extern EI_S32 VISS_SetPinState(VISS_DEV dev, CAMERA_POWER_ACT_S *pAct, EI_U32 u32Cnt);

EI_S32 CAMERA_OpenI2c(SNS_STATE_S *pstSnsState);
EI_S32 CAMERA_ExitI2c(SNS_STATE_S *pstSnsState);

#define cprintf(fmt, args...)\
do{ \
    printf("%s %d "fmt, __func__, __LINE__, ##args);\
} while(0)

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /*__cplusplus */

#endif /*__EI_COMM_CAMERA_H__ */
